/*****************************************************************************
 * Name        : Money.h
 * Author      : Savitch
 * Version     : 2.0
 * Copyright   : You are free to use this code - it is from "Absolute C++" by Savitch
 * Description : Money example from Chapter 8 of Savitch
 *               Note that we did not need any #includes in this file.
 *               Avoid #include'ing in .h files.
 *               Save #include's for the .cpp files whenever possible.
 ******************************************************************************/

#ifndef MONEY_H_
#define MONEY_H_

class Money {
public:
    Money( );
    Money(double amount);
    Money(int theDollars, int theCents);
    Money(int theDollars);
    double getAmount( ) const;
    int getDollars( ) const;
    int getCents( ) const;
    void input( ); //Reads the dollar sign as well as the amount number.
    void output( ) const;
private:
    int dollars; //A negative amount is represented as negative dollars and
    int cents; //negative cents. Negative $4.50 is represented as -4 and -50

    int dollarsPart(double amount) const;
    int centsPart(double amount) const;
    int round(double number) const;
};

#endif /* MONEY_H_ */
